﻿Public Class Class_SAP

    Public Function SAP_OPEN() As Object
        Dim Connector As New SAP.Connector.Destination
        Dim SAP_Data As Object = New SAP_IPORT.SAP_IPORT_FUNCTION
        Try
            Connector.AppServerHost = SAPServer
            Connector.SystemNumber = CInt(SAPSystemNumber)
            Connector.Client = CInt(SAPClient)

            Connector.Username = SAPUsername
            Connector.Password = SAPPassword

            SAP_Data.Connection = New SAP.Connector.SAPConnection(Connector)
            SAP_Data.Connection.Open()

        Catch ex As Exception

        End Try
        Return SAP_Data
    End Function

    Public Sub SAP_CLOSE(ByRef SAP_DATA As Object)
        SAP_DATA.Connection.Close()
    End Sub
End Class
